﻿using System;

using Fuse8.DomainFramework.Common.Locator;

namespace Fuse8.DomainFramework.Common.Logging
{
    /// <summary>
    /// 
    /// </summary>
    public static class LoggingFacade
    {
        private static ILogging _log = DependencyServiceLocator.Current.GetInstance<ILogging>();
        
        /// <summary>
        /// 
        /// </summary>
        /// <param name="category"></param>
        /// <param name="message"></param>
        public static void Log(string category, string message)
        {
            Guard.ArgumentNotEmpty(category, "category");
            Guard.ArgumentNotEmpty(message, "message");

            _log.Log(category, message);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="message"></param>
        /// <param name="ex"></param>
        public static void LogError(string message, Exception ex)
        {            
            Guard.ArgumentNotEmpty(message, "message");
            Guard.ArgumentNotNull(ex, "ex");

            _log.LogError(message, ex);
        }
    }
}
